/*
 * @Author: boyyang
 * @Date: 2022-01-28 11:21:19
 * @LastEditTime: 2022-01-28 15:15:01
 * @LastEditors: boyyang
 * @Description: 
 * @FilePath: \boyyang\src\plugin\utils\componentsRegister.ts
 */

import { App } from "vue"

const componentsRegister = (components: object, app: App, prefix: string) => {
    const _components = Object.keys(components).map((key) => {
        return { name: `${prefix}${key}`, component: components[key as keyof typeof components] }
    })

    for (let i = 0; i < _components.length; i++) {
        app.component(_components[i].name, _components[i].component)
    }
}


export {
    componentsRegister
}
